import React, {Component} from 'react';
import {StyleSheet, Text, View, Image, ScrollView, Alert} from 'react-native';
import My from '~/pages/my/My';
import DevelopMy from '~/pages/my/DevelopMy';
import AgencyMy from '~/pages/my/AgencyMy';
import BankMy from '~/pages/my/BankMy';
import {connect} from 'react-redux';

const mapGetter = (state) => {
    return {
        userinfo: state.userinfo,
        system: state.system,
        parkorder: state.parkorder,
    };
};
class SelectMy extends Component {
    static navigationOptions = {
        title: '',
        headerTransparent: true,
    };
    constructor(props) {
        //调用基类的所有的初始化方法
        super(props);
        // 设置当前组件的属性
        this.state = {};
    }

    render() {
        return (
            <>
                {this.props.userinfo.identity === 31 && <AgencyMy navigation={this.props.navigation} />}
                {this.props.userinfo.identity === 8 && <My navigation={this.props.navigation} />}
                {this.props.userinfo.identity === 11 && <DevelopMy navigation={this.props.navigation} />}
                {this.props.userinfo.identity === 21 && <BankMy navigation={this.props.navigation} />}
            </>
        );
    }
}

const styles = StyleSheet.create({});
export default connect(mapGetter)(SelectMy);
